<link href="<?php echo base_url();?>css/share/upload.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
$(document).ready(function(){
	$("#description").click(function(){
		if($(this).val() == "请填写描述"){
			$(this).val("");
			$(this).removeAttr("style");
		}
		
	});	
});
function data_examine(theform){
	if(theform.title.value=="")
	{
		alert("标题不能为空！");
		theform.title.focus();
		return false;
	}
	if(theform.title.value.length > 25)
	{
		alert("标题长度应小于25！");
		theform.title.focus();
		return false;
	}
	if(theform.description.value=="")
	{
		alert("描述不能为空！");
		theform.description.focus();
		return false;
	}
	$("#form").submit();
}


//-->
</script>

<div id="aside" class="aside">
	<div class="guide_box">
		<div class="content">
			<p>学海拾贝是完全自由的资料分享平台。所有同学可以自由地上传、下载有用的文档资料。</p>
			<p>请注意您上传的资料符合有关版权所有者的同意，避免上传不予公开的资料。对于已经公开的试卷、学习资料等，我们欢迎您的贡献！</p>	
		
		</div>
	</div>
</div>

<div id="main" class="main">
<div id="upload_form" class="multi-upload" style="">



<?php echo $error;?>

<h3>填写文档信息(*为必填项)</h3>
<form action="<?php echo site_url("share/upload/do_upload");?>" id="form"  method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="20971520" />
<!--just test here-->
<label for="title">标题</label>

<input id="title" type="text" name="title"  class="wide_input" maxlength=25>*
<br />
<label>类别</label>
<select name="category" id="category_select">
<?php foreach($category as $key => $value)
					echo '<option value="'.$key.'">'.$value.'</option>';
?>
</select>
<br>
<label for="subject">科目</label>
<input id="subject" type="text" class="wide_input" name="subject">
<br />
<label for="year">年份</label>
<input id="year" type="text" class="wide_input" name="year">
<br />
<label for="tag">标签</label>
<input id="tag" type="text" name="tag"  class="wide_input">
<br />
<div >
	<span id="miaoshu"><label for="description">描述</label></span>
	<span><textarea id="description" rows="5" cols="60" name="description" style="color:gray;">请填写描述</textarea></span>*
</div>			

<input type="file" name="userfile" class="input-file size="20" style="width:150px"  class="wide_input"/>*上传文件最大为20MB
<br />
<input type="button" class="input-button" value="上传" onclick="data_examine(form)" />
</form>



</div>


</div>

